/*
 * ClientSocket.h
 *
 *  Created on: 2013-1-15
 *      Author: root
 */

#ifndef CLIENTSOCKET_H_
#define CLIENTSOCKET_H_

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <pthread.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/tcp.h>
#include "DateTime.h"
#include "Command.h"










class ClientSocket {
public:
	ClientSocket();
	ClientSocket(char* sServer,int iPort);
	virtual ~ClientSocket();
public:
	int ConnectToServer();
	int Start();
	void SetNotBlock();

	int Read(char* buf,int len,double timeout);
	int Write(char* buf,int len);


	int m_fd;
	char* m_sServer;
	int m_iPort;
	pthread_t m_pthClient;
private:




};
extern ClientSocket *pClientSocket;
#endif /* CLIENTSOCKET_H_ */
